﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FStore.Crypto
{
	/// <summary>
	/// Interface for defining hash providers
	/// </summary>
	public interface IHashProvider
	{
		/// <summary>
		/// Computes a hash of a string
		/// </summary>
		/// <param name="data">The string to compute the hash of</param>
		/// <param name="asHex">Whether to express the hash as a Hex string</param>
		/// <param name="hyphenate">Whether to hyphenate the Hex values</param>
		/// <returns>The hash as a unicode string</returns>
		string ComputeHashAsString(string data, bool asHex = false, bool hyphenate = false);

		/// <summary>
		/// Computes a hash of string data
		/// </summary>
		/// <param name="data">The byte array to compute the hash of</param>
		/// <returns>The hash as a byte array</returns>
		byte[] ComputeHashAsByte(string data);

		/// <summary>
		/// Computes a hash of a byte array
		/// </summary>
		/// <param name="data">The byte array to compute the hash of</param>
		/// <param name="asHex">Whether to express the hash as a Hex string</param>
		/// <param name="hyphenate">Whether to hyphenate the Hex values</param>
		/// <returns>The hash as a unicode string</returns>
		string ComputeHashAsString(byte[] data, bool asHex = false, bool hyphenate = false);

		/// <summary>
		/// Computes a hash of a byte array
		/// </summary>
		/// <param name="data">The byte array to compute the hash of</param>
		/// <returns>The hash as a byte array</returns>
		byte[] ComputeHashAsByte(byte[] data);

	}
}
